package com.publiccms.entities.trade;
// Generated 2023-8-7 21:42:23 by Hibernate Tools 5.6.15.Final

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.publiccms.common.database.CmsUpgrader;
import com.publiccms.common.generator.annotation.GeneratorColumn;

/**
 * TradeCoupon generated by hbm2java
 */
@Entity
@Table(name = "trade_coupon")
public class TradeCoupon implements java.io.Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @GeneratorColumn(title = "ID")
    private Long id;
    @GeneratorColumn(title = "站点", condition = true)
    @JsonIgnore
    private short siteId;
    /**
     * name
     * <p>
     * 名称
     */
    @GeneratorColumn(title = "名称")
    @NotNull
    @Length(max = 100)
    private String name;
    /**
     * category
     * <p>
     * 分类
     */
    @GeneratorColumn(title = "分类", condition = true)
    private Integer categoryId;
    /**
     * content
     * <p>
     * 内容
     */
    @GeneratorColumn(title = "内容", condition = true)
    private Long contentId;
    private String startDate;
    private String expiryDate;
    private BigDecimal startingAmount;
    private BigDecimal discount;
    private BigDecimal price;
    private int type;
    private String redeemCode;
    private int duration;
    private int quantity;
    private String createDate;
    private boolean disabled;

    public TradeCoupon() {
    }

    public TradeCoupon(short siteId, String name, String startDate, int type, int duration, int quantity, boolean disabled) {
        this.siteId = siteId;
        this.name = name;
        this.startDate = startDate;
        this.type = type;
        this.duration = duration;
        this.quantity = quantity;
        this.disabled = disabled;
    }

    public TradeCoupon(short siteId, String name, Integer categoryId, Long contentId, String startDate, String expiryDate,
            BigDecimal startingAmount, BigDecimal discount, BigDecimal price, int type, String redeemCode, int duration,
            int quantity, String createDate, boolean disabled) {
        this.siteId = siteId;
        this.name = name;
        this.categoryId = categoryId;
        this.contentId = contentId;
        this.startDate = startDate;
        this.expiryDate = expiryDate;
        this.startingAmount = startingAmount;
        this.discount = discount;
        this.price = price;
        this.type = type;
        this.redeemCode = redeemCode;
        this.duration = duration;
        this.quantity = quantity;
        this.createDate = createDate;
        this.disabled = disabled;
    }

    @Id
    @GeneratedValue(generator = "cmsGenerator")
    @GenericGenerator(name = "cmsGenerator", strategy = CmsUpgrader.IDENTIFIER_GENERATOR)
    @Column(name = "id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "site_id", nullable = false)
    public short getSiteId() {
        return this.siteId;
    }

    public void setSiteId(short siteId) {
        this.siteId = siteId;
    }

    @Column(name = "name", nullable = false)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "category_id")
    public Integer getCategoryId() {
        return this.categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    @Column(name = "content_id")
    public Long getContentId() {
        return this.contentId;
    }

    public void setContentId(Long contentId) {
        this.contentId = contentId;
    }

    @Column(name = "start_date", nullable = false)
    public String getStartDate() {
        return this.startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    @Column(name = "expiry_date")
    public String getExpiryDate() {
        return this.expiryDate;
    }

    public void setExpiryDate(String expiryDate) {
        this.expiryDate = expiryDate;
    }

    @Column(name = "starting_amount", precision = 10)
    public BigDecimal getStartingAmount() {
        return this.startingAmount;
    }

    public void setStartingAmount(BigDecimal startingAmount) {
        this.startingAmount = startingAmount;
    }

    @Column(name = "discount", precision = 10, scale = 1)
    public BigDecimal getDiscount() {
        return this.discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    @Column(name = "price", precision = 10)
    public BigDecimal getPrice() {
        return this.price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    @Column(name = "type", nullable = false)
    public int getType() {
        return this.type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Column(name = "redeem_code")
    public String getRedeemCode() {
        return this.redeemCode;
    }

    public void setRedeemCode(String redeemCode) {
        this.redeemCode = redeemCode;
    }

    @Column(name = "duration", nullable = false)
    public int getDuration() {
        return this.duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    @Column(name = "quantity", nullable = false)
    public int getQuantity() {
        return this.quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    @Column(name = "create_date")
    public String getCreateDate() {
        return this.createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    @Column(name = "disabled", nullable = false)
    public boolean isDisabled() {
        return this.disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

}
